﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Security.Principal;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Security;
using System.Web.UI;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data.SqlServer;
using System.Web;
using System.Configuration;

namespace Ashlen.Portal.Controllers
{
    [HandleError]
    [OutputCache(Location = OutputCacheLocation.None)]
    public class AdministrationController : Controller
    {
        #region Local Variables
        private readonly ISecurityDao _securityDao;
        private readonly ILookupDao _lookUpDao;
        private readonly IUtilityDao _utility;
        #endregion

        #region Constructor
        public AdministrationController()
        {
            _securityDao = new SecurityDao();
            _lookUpDao = new LookupDao();
            _utility = new UtilityDao();
        }

        public AdministrationController(ISecurityDao securityDao, ILookupDao lookupDao, IUtilityDao utilityDao)
        {
            _securityDao = securityDao;
            _lookUpDao = lookupDao;
            _utility = utilityDao;
        }

        public AdministrationController(string connectionString)
        {
            _lookUpDao = new LookupDao(connectionString);
            _securityDao = new SecurityDao(connectionString);
            _utility = new UtilityDao(connectionString);
        }
        #endregion

        [Authorize(Roles="administrator")]
        public ActionResult Index()
        {
            ViewData["Title"] = Ashlen.Portal.Data.SqlServer.UtilityDao.Instance.GetConfig(Ashlen.Portal.Data.SqlServer.Constants.APPLICATION, "ApplicationName") + " - Administration";
            ViewData["Message"] = "Welcome to !" + Ashlen.Portal.Data.SqlServer.UtilityDao.Instance.GetConfig(Ashlen.Portal.Data.SqlServer.Constants.APPLICATION, "ApplicationName");

            return View();
        }
    }
}
